<template>
	<view  class="content-container">
		<view v-if="detail && detail.isLink=='N'" style="width: 100%;">
			<view class="title">
				<uni-title type="h1" :title="detail.title" align="center"></uni-title>
			</view>
			<view>
				<uni-row>
					<uni-col :span="2">
						<image class="logo-img" :src="apiurl+detail.logo"></image>
					</uni-col>
					<uni-col :span="8">
						<text class="rich_media_meta">{{detail.departName}}</text>
					</uni-col>
					<uni-col :span="14" class="align-right">
						<text class="rich_media_meta">
							{{detail.createTime}}
						</text>
					</uni-col>
				</uni-row>
			</view>
			<view  v-html="detail.content"></view>
		</view>
		<view v-if="detail && detail.isLink=='Y'">
			<web-view :src="detail.url"></web-view>
		</view>
	</view>
</template>

<script>
	import mpHtml from '@/components/mp-html/mp-html'
	export default {
		components: {
			mpHtml
		},
		data() {
			return {
				apiurl:'',
				id:"",
				detail:{}
			}
		},
		onLoad:function(option){
			 this.apiurl = getApp().globalData.staticUrl
		     this.id = option.id
		     uni.setNavigationBarTitle({
		         title:option.title
		     })
			 this.$http.get('/temple.news/templeNews/api/queryById?id='+this.id, {}).then((res) => {
			 	//this.list = res.data.result.records;
				this.detail = res.data.result
				this.$http.get('/sys/sysDepart/api/getDepartName', {
					'orgCode':this.detail.sysOrgCode
				}).then((res) => {
					this.$set(this.detail,'departName',res.data.result.departName)
				})
				this.$http.get('/temple.appearance/templeLogo/api/getOne', {
				}).then((res) => {
					console.log(res)
					this.$set(this.detail,'logo',res.data.result.img)
				})
			 })
		},
		methods: {
			
		}
	}
</script>

<style>
	.logo-img{
		width: 20px;
		height: 20px;
	}
	
	.rich_media_title {
		font-size: 22px;
		line-height: 1.4;
		margin-bottom: 14px;
	}
	.rich_media_meta {
	    display: inline-block;
	    vertical-align: middle;
	    margin: 0 10px 10px 0;
	    font-size: 15px;
	    -webkit-tap-highlight-color: rgba(0,0,0,0);
		color: rgba(0,0,0,.3);
	}
</style>
